package com.dna.service.impl;

import com.dna.entity.ItemMaterialConfirmEntity;
import com.dna.entity.ItemMaterialEntity;
import com.dna.mapper.ItemMaterialConfirmMapper;
import com.dna.mapper.ItemMaterialMapper;
import com.dna.service.ItemMaterialConfirmService;
import com.dna.service.ItemMaterialService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

@Service
public class ItemMaterialConfirmServiceImpl implements ItemMaterialConfirmService {

    @Autowired
    private ItemMaterialConfirmMapper itemMaterialConfirmMapper;

    @Override
    public List<ItemMaterialConfirmEntity> queryAll() {
        List<ItemMaterialConfirmEntity> deptList = itemMaterialConfirmMapper.selectAll();
        
        return deptList;
    }

    @Override
    public ItemMaterialConfirmEntity queryOne(ItemMaterialConfirmEntity dep) {
        return itemMaterialConfirmMapper.selectOne(dep);
    }

    @Override
    @Transactional
    public void save(ItemMaterialConfirmEntity dep) {
        itemMaterialConfirmMapper.insertSelective(dep);

    }

    @Override
    @Transactional
    public void update(ItemMaterialConfirmEntity dep) {
        itemMaterialConfirmMapper.updateByPrimaryKeySelective(dep);
    }

    @Override
    public void delete(ItemMaterialConfirmEntity itemMaterialConfirm, Example example) {
        itemMaterialConfirmMapper.updateByExampleSelective(itemMaterialConfirm, example);
    }

}
